package com.sheepone.distributor.test;

import com.sheepone.distributor.DistributorApplication;
import com.sheepone.distributor.anno.StationEventListener;
import com.sheepone.distributor.listener.WorkerEventListener;
import lombok.extern.slf4j.Slf4j;

/**
 * @author Miss.杨
 * @description
 * @since 2023-12-13 16:01
 */
@Slf4j
@StationEventListener(station = StationConstants.READ,topic = TopicConstants.READ)
public class ReadStringListener implements WorkerEventListener<StringContext> {

    @Override
    public void onEvent(StringContext context) {
        DistributorApplication.read.increment();
        if(context.getValue().length()>20){
            log.info("value:"+context.getValue());
        }
    }
}
